package com.wyl.controller

import com.wyl.services.BookService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Controller
import org.springframework.ui.Model
import org.springframework.web.bind.annotation.RequestMapping

@Controller
@RequestMapping("/book")
class BookController {
    @Autowired
    lateinit var bookService: BookService

    @RequestMapping("/allBook")
    fun list(model: Model): String {
        val list = bookService.queryAll()
        model.addAttribute("list", list)
        return "allBook"
    }
}